const Router=require('koa-router')
const router=new Router({prefix:'/carts'})
const {validator}=require('../middleWare/cart.middleware')
const {addCart,findAll,updateC,remove,SelectAll}=require('../controller/cart.controller')
//中间件
const {auth}=require('../middleWare/auth.middleware')
//添加购物车接口
router.post('/',auth,addCart)
//获取购物车列表
router.get('/',auth,findAll)
//更新购物车
router.patch('/:id',auth,updateC)
//删除购物车
router.delete('/',auth,remove)
//全选
router.post('/selectAll',auth,SelectAll)
module.exports=router